
package org.test.redis.connector;

import org.springframework.beans.factory.annotation.Autowired;
import redis.clients.jedis.Jedis;

/**
 * Created by wangyg 
 * on 2017/3/9 11:02
 */
public class DefaultConnector {
	//	@Autowired
	private static Jedis jedis;

	public static void getConnect() {
		jedis = new Jedis("123.57.218.203", 6380);
		jedis.auth("root");
	}

	public static void main(String[] args) {
		//		DefaultConnector dc=new DefaultConnector();
		DefaultConnector.getConnect();
		String db = jedis.select(0);
		for (int i = 0; i < 100; i++) {
			jedis.set("Run" + i, "Run" + i);
		}
		System.out.println("insert success.");

		for (int i = 0; i < 100; i++) {
			System.out.println(jedis.get("Run" + i));
		}
	}
}
